package data_structure;

import java.util.ArrayList;
import java.util.List;

public class leetcode_0145 {
    public List<Integer> postorderTraversal(TreeNode root) {
        List<Integer> list=new ArrayList<>();
        late(list,root);
        return list;
    }
    public void late(List<Integer> list,TreeNode node){
        if(node==null) return;

        late(list,node.left);

        late(list,node.right);
        list.add(node.val);
    }
}
